local thbattle__qilunuo_wanmeidongjie = fk.CreateSkill {

  name = "thbattle__qilunuo_wanmeidongjie",

  tags = {  },

}



thbattle__qilunuo_wanmeidongjie:addEffect(fk.DamageCaused, {
  prompt = "#thbattle__qilunuo_wanmeidongjie",
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(thbattle__qilunuo_wanmeidongjie.name) and data.from == player and data.card and
        (data.card.trueName == "slash" or data.card.trueName == "duel")
  end,
  on_use = function(self, event, target, player, data)
    local targetPlayer = data.to
    local room = player.room
    if targetPlayer:isNude() then
      data:preventDamage()
    end
    local discard, hand_cids
    hand_cids = targetPlayer:getCardIds("h")
    discard = room:askForDiscard(targetPlayer, 1, 1, true, thbattle__qilunuo_wanmeidongjie.name, false, ".|.|.|equip,hand",
      "#thbattle__qilunuo_wanmeidongjie-discard",true)[1]
    room:throwCard(discard,thbattle__qilunuo_wanmeidongjie.name,targetPlayer,player)
    if discard and #hand_cids > 0 and table.contains(hand_cids, discard) then
      room:loseHp(targetPlayer, 1, thbattle__qilunuo_wanmeidongjie.name)
    end
    data:preventDamage()
  end
})

return thbattle__qilunuo_wanmeidongjie